package com.ruoyi.wgjlcData.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.wgjlcData.domain.plat.DataWgjlcZxtgbj;
import com.ruoyi.wgjlcData.service.IDataWgjlcZxtgbjService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 无轨胶轮车最小通过半径（激光\GPS）测试项Controller
 * 
 * @author ruoyi
 * @date 2024-02-27
 */
@RestController
@RequestMapping("/wgjlc/zxtgbj")
public class DataWgjlcZxtgbjController extends BaseController
{
    @Autowired
    private IDataWgjlcZxtgbjService dataWgjlcZxtgbjService;

    /**
     * 查询无轨胶轮车最小通过半径（激光\GPS）测试项列表
     */
    @PreAuthorize("@ss.hasPermi('wgjlc:zxtgbj:list')")
    @GetMapping("/list")
    public TableDataInfo list(DataWgjlcZxtgbj dataWgjlcZxtgbj)
    {
        startPage();
        List<DataWgjlcZxtgbj> list = dataWgjlcZxtgbjService.selectDataWgjlcZxtgbjList(dataWgjlcZxtgbj);
        return getDataTable(list);
    }

    /**
     * 导出无轨胶轮车最小通过半径（激光\GPS）测试项列表
     */
    @PreAuthorize("@ss.hasPermi('wgjlc:zxtgbj:export')")
    @Log(title = "无轨胶轮车最小通过半径（激光GPS）测试项", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, DataWgjlcZxtgbj dataWgjlcZxtgbj)
    {
        List<DataWgjlcZxtgbj> list = dataWgjlcZxtgbjService.selectDataWgjlcZxtgbjList(dataWgjlcZxtgbj);
        ExcelUtil<DataWgjlcZxtgbj> util = new ExcelUtil<DataWgjlcZxtgbj>(DataWgjlcZxtgbj.class);
        util.exportExcel(response, list, "无轨胶轮车最小通过半径（激光GPS）测试项数据");
    }

    /**
     * 获取无轨胶轮车最小通过半径（激光\GPS）测试项详细信息
     */
    @PreAuthorize("@ss.hasPermi('wgjlc:zxtgbj:query')")
    @GetMapping(value = "/{zxtgbjId}")
    public AjaxResult getInfo(@PathVariable("zxtgbjId") Long zxtgbjId)
    {
        return success(dataWgjlcZxtgbjService.selectDataWgjlcZxtgbjByZxtgbjId(zxtgbjId));
    }

    /**
     * 新增无轨胶轮车最小通过半径（激光\GPS）测试项
     */
    @PreAuthorize("@ss.hasPermi('wgjlc:zxtgbj:add')")
    @Log(title = "无轨胶轮车最小通过半径（激光GPS）测试项", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody DataWgjlcZxtgbj dataWgjlcZxtgbj)
    {
        return toAjax(dataWgjlcZxtgbjService.insertDataWgjlcZxtgbj(dataWgjlcZxtgbj));
    }

    /**
     * 修改无轨胶轮车最小通过半径（激光\GPS）测试项
     */
    @PreAuthorize("@ss.hasPermi('wgjlc:zxtgbj:edit')")
    @Log(title = "无轨胶轮车最小通过半径（激光GPS）测试项", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody DataWgjlcZxtgbj dataWgjlcZxtgbj)
    {
        return toAjax(dataWgjlcZxtgbjService.updateDataWgjlcZxtgbj(dataWgjlcZxtgbj));
    }

    /**
     * 删除无轨胶轮车最小通过半径（激光\GPS）测试项
     */
    @PreAuthorize("@ss.hasPermi('wgjlc:zxtgbj:remove')")
    @Log(title = "无轨胶轮车最小通过半径（激光GPS）测试项", businessType = BusinessType.DELETE)
	@DeleteMapping("/{zxtgbjIds}")
    public AjaxResult remove(@PathVariable Long[] zxtgbjIds)
    {
        return toAjax(dataWgjlcZxtgbjService.deleteDataWgjlcZxtgbjByZxtgbjIds(zxtgbjIds));
    }
}
